<?php
//PingBuWang.Com
//Copyright (c) 2017~2099 http://www.pingbuwang.com All rights reserved.
namespace app\setting\model;

use think\Cache;
use mip\Paginationm;
use think\Db;
use think\Log;
use think\Model;
use think\Controller;

class Template extends Model
{
    public function getInfoByFileName( $filename ){
        if (is_file(PUBLIC_PATH . 'tpl' . DS . $filename . DS . 'template.json')) {
            $templateJson = file_get_contents(PUBLIC_PATH . 'tpl' . DS . $filename . DS . 'template.json');

            $info1 = json_decode($templateJson);
            $pc_thumbnail = config('mipInfo')['domain'] .'/tpl/'.$filename.'/'.$info1->pc_thumbnail;
            $mobile_thumbnail = config('mipInfo')['domain'] .'/tpl/'.$filename.'/'.$info1->mobile_thumbnail;

            $res = array('fileName' => $filename, 'pc_thumbnail'=>$pc_thumbnail,'mobile_thumbnail'=> $mobile_thumbnail ,'info' => $info1 );

            return $res;
        }

        return false;
    }

}